﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<TemplateWeb.Models.ViewModels.GroupViewModel>" %>

<div class="box_border" style="margin: 10px 0 12px 10px; border: none;">
    <div class="NewsDetail">
        <div class="NewsDetail-title">
            <h1 class="titlePage">Video: <%= Model.VideoModel.GetModel.LstObjModel[0].TenVideo %></h1>
        </div>
        <div class="ArticleContent">
            <iframe width="710" height="450" src="<%= Model.VideoModel.GetModel.LstObjModel[0].URL %>" frameborder="0" allowfullscreen></iframe>
        </div>
        <div class="other"></div>
    </div>
    <br />
    <br />
    <%
        var lstOtherVideo = Model.AlbumModel.GetModel.LstObjModel[0].Video.Where(n=>n.ID != Model.VideoModel.GetModel.LstObjModel[0].ID).ToList();
        if (lstOtherVideo.Count > 0)
        {
    %>
        <div class="NewsDetail">
            <div class="NewsDetail-title">
                <h1 class="titlePage">Các video khác trong cùng album: <%= Model.AlbumModel.GetModel.LstObjModel[0].TenAlbum%></h1>
            </div>
            <div class="ArticleContent">
                <div class="topProducts">
                    <% 
    int numRow = 0;
    for (int i = 0; i < lstOtherVideo.Count; i++)
    {
        if (i % 4 == 0)
        {
            numRow++;
            if (numRow < (lstOtherVideo.Count % 4 == 0 ? lstOtherVideo.Count / 4 : (lstOtherVideo.Count / 4 + 1)))
            { %>
                                    <ul class="goiThietKeWebTheoNganh" style="margin-left: 0px; padding-left: 30px;">
                            <% }
            else
            { %>
                                    <ul style="margin-left: 0px; padding-left: 30px; list-style: none; height: 160px;">
                            <% }
        } %>

                                        <li>
                                            <div class="itemProducts">
                                                <a href="<%= Url.Action("ShowVideo", "Home", new { idalbum = Model.AlbumModel.GetModel.LstObjModel[0].ID, id = lstOtherVideo[i].ID }) %>">
                                                    <img src="../../Content/Images/Items/<%= lstOtherVideo[i].HinhMinhHoa %>" alt="" border="0" />
                                                </a>
                                                <a href="<%= Url.Action("ShowVideo", "Home", new { idalbum = Model.AlbumModel.GetModel.LstObjModel[0].ID, id = lstOtherVideo[i].ID }) %>"><%= lstOtherVideo[i].TenVideo%></a>
                                            </div>
                                        </li>

                        <% if (i % 4 == 3)
                           { %>
                            </ul>
                        <% } %>
                    <% } %>
                </div>
            </div>
        </div>
    <% } %>
</div>